﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Text.RegularExpressions;
using MessagePack.Formatters;

namespace MessagePack.Internal
{
	// Token: 0x02000112 RID: 274
	internal static class DynamicObjectTypeBuilder
	{
		// Token: 0x060003D7 RID: 983 RVA: 0x0000E93C File Offset: 0x0000CD3C
		public static TypeInfo_wzh BuildType(DynamicAssembly assembly, Type type, bool forceStringKey)
		{
			if (DynamicObjectTypeBuilder.ignoreTypes.Contains(type))
			{
				return null;
			}
			ObjectSerializationInfo objectSerializationInfo = ObjectSerializationInfo.CreateOrNull(type, forceStringKey);
			if (objectSerializationInfo == null)
			{
				return null;
			}
			Type type2 = typeof(IMessagePackFormatter<>).MakeGenericType(new Type[]
			{
				type
			});
			TypeBuilder typeBuilder = assembly.ModuleBuilder.DefineType("MessagePack.Formatters." + DynamicObjectTypeBuilder.SubtractFullNameRegex.Replace(type.FullName, string.Empty).Replace(".", "_") + "Formatter", TypeAttributes.Public | TypeAttributes.Sealed, null, new Type[]
			{
				type2
			});
			FieldBuilder dictionaryField = null;
			if (objectSerializationInfo.IsStringKey)
			{
				ConstructorBuilder constructorBuilder = typeBuilder.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, Type.EmptyTypes);
				dictionaryField = typeBuilder.DefineField("keyMapping", typeof(Dictionary<string, int>), FieldAttributes.Private | FieldAttributes.InitOnly);
				ILGenerator ilgenerator = constructorBuilder.GetILGenerator();
				DynamicObjectTypeBuilder.BuildConstructor(type, objectSerializationInfo, constructorBuilder, dictionaryField, ilgenerator);
			}
			MethodBuilder methodBuilder = typeBuilder.DefineMethod("Serialize", MethodAttributes.FamANDAssem | MethodAttributes.Family | MethodAttributes.Final | MethodAttributes.Virtual, typeof(int), new Type[]
			{
				typeof(byte[]).MakeByRefType(),
				typeof(int),
				type,
				typeof(IFormatterResolver)
			});
			ILGenerator ilgenerator2 = methodBuilder.GetILGenerator();
			DynamicObjectTypeBuilder.BuildSerialize(type, objectSerializationInfo, methodBuilder, ilgenerator2);
			MethodBuilder methodBuilder2 = typeBuilder.DefineMethod("Deserialize", MethodAttributes.FamANDAssem | MethodAttributes.Family | MethodAttributes.Final | MethodAttributes.Virtual, type, new Type[]
			{
				typeof(byte[]),
				typeof(int),
				typeof(IFormatterResolver),
				typeof(int).MakeByRefType()
			});
			ILGenerator ilgenerator3 = methodBuilder2.GetILGenerator();
			DynamicObjectTypeBuilder.BuildDeserialize(type, objectSerializationInfo, methodBuilder2, dictionaryField, ilgenerator3);
			//return typeBuilder.CreateTypeInfo();
			return null;
		}

		// Token: 0x060003D8 RID: 984 RVA: 0x0000EAEC File Offset: 0x0000CEEC
		private static void BuildConstructor(Type type, ObjectSerializationInfo info, ConstructorInfo method, FieldBuilder dictionaryField, ILGenerator il)
		{
			il.EmitLdarg(0);
			il.Emit(OpCodes.Call, DynamicObjectTypeBuilder.objectCtor);
			il.EmitLdarg(0);
			il.EmitLdc_I4(info.Members.Length);
			il.Emit(OpCodes.Newobj, DynamicObjectTypeBuilder.dictionaryConstructor);
			foreach (ObjectSerializationInfo.EmittableMember emittableMember in info.Members)
			{
				il.Emit(OpCodes.Dup);
				il.Emit(OpCodes.Ldstr, emittableMember.StringKey);
				il.EmitLdc_I4(emittableMember.IntKey);
				il.EmitCall(DynamicObjectTypeBuilder.dictionaryAdd);
			}
			il.Emit(OpCodes.Stfld, dictionaryField);
			il.Emit(OpCodes.Ret);
		}

		// Token: 0x060003D9 RID: 985 RVA: 0x0000EBAC File Offset: 0x0000CFAC
		private static void BuildSerialize(Type type, ObjectSerializationInfo info, MethodInfo method, ILGenerator il)
		{
			if (type.GetTypeInfo_wzh().IsClass)
			{
				Label label = il.DefineLabel();
				il.EmitLdarg(3);
				il.Emit(OpCodes.Brtrue_S, label);
				il.EmitLdarg(1);
				il.EmitLdarg(2);
				il.EmitCall(DynamicObjectTypeBuilder.MessagePackBinaryTypeInfo.WriteNil);
				il.Emit(OpCodes.Ret);
				il.MarkLabel(label);
			}
			if (type.GetTypeInfo_wzh().ImplementedInterfaces.Any((Type x) => x == typeof(IMessagePackSerializationCallbackReceiver)))
			{
				MethodInfo[] array = (from x in type.GetRuntimeMethods()
				where x.Name == "OnBeforeSerialize"
				select x).ToArray<MethodInfo>();
				if (array.Length == 1)
				{
					if (info.IsStruct)
					{
						il.EmitLdarga(3);
					}
					else
					{
						il.EmitLdarg(3);
					}
					il.Emit(OpCodes.Call, array[0]);
				}
				else
				{
					il.EmitLdarg(3);
					if (info.IsStruct)
					{
						il.Emit(OpCodes.Box, type);
					}
					il.EmitCall(DynamicObjectTypeBuilder.onBeforeSerialize);
				}
			}
			LocalBuilder local = il.DeclareLocal(typeof(int));
			il.EmitLdarg(2);
			il.EmitStloc(local);
			if (info.IsIntKey)
			{
				int maxKey = (from x in info.Members
				where x.IsReadable
				select x.IntKey).DefaultIfEmpty(-1).Max();
				Dictionary<int, ObjectSerializationInfo.EmittableMember> dictionary = (from x in info.Members
				where x.IsReadable
				select x).ToDictionary((ObjectSerializationInfo.EmittableMember x) => x.IntKey);
				DynamicObjectTypeBuilder.EmitOffsetPlusEqual(il, null, delegate
				{
					int num = maxKey + 1;
					il.EmitLdc_I4(num);
					if (num <= 15)
					{
						il.EmitCall(DynamicObjectTypeBuilder.MessagePackBinaryTypeInfo.WriteFixedArrayHeaderUnsafe);
					}
					else
					{
						il.EmitCall(DynamicObjectTypeBuilder.MessagePackBinaryTypeInfo.WriteArrayHeader);
					}
				});
				for (int i = 0; i <= maxKey; i++)
				{
					ObjectSerializationInfo.EmittableMember member;
					if (dictionary.TryGetValue(i, out member))
					{
						DynamicObjectTypeBuilder.EmitSerializeValue(il, type.GetTypeInfo_wzh(), member);
					}
					else
					{
						DynamicObjectTypeBuilder.EmitOffsetPlusEqual(il, null, delegate
						{
							il.EmitCall(DynamicObjectTypeBuilder.MessagePackBinaryTypeInfo.WriteNil);
						});
					}
				}
			}
			else
			{
				int writeCount = info.Members.Count((ObjectSerializationInfo.EmittableMember x) => x.IsReadable);
				DynamicObjectTypeBuilder.EmitOffsetPlusEqual(il, null, delegate
				{
					il.EmitLdc_I4(writeCount);
					if (writeCount <= 15)
					{
						il.EmitCall(DynamicObjectTypeBuilder.MessagePackBinaryTypeInfo.WriteFixedMapHeaderUnsafe);
					}
					else
					{
						il.EmitCall(DynamicObjectTypeBuilder.MessagePackBinaryTypeInfo.WriteMapHeader);
					}
				});
				using (IEnumerator<ObjectSerializationInfo.EmittableMember> enumerator = (from x in info.Members
				where x.IsReadable
				select x).GetEnumerator())
				{
					while (enumerator.MoveNext())
					{
						ObjectSerializationInfo.EmittableMember item = enumerator.Current;
						if (info.IsStringKey)
						{
							DynamicObjectTypeBuilder.EmitOffsetPlusEqual(il, null, delegate
							{
								il.Emit(OpCodes.Ldstr, item.StringKey);
								il.EmitLdc_I4(StringEncoding.UTF8.GetByteCount(item.StringKey));
								il.EmitCall(DynamicObjectTypeBuilder.MessagePackBinaryTypeInfo.WriteStringUnsafe);
							});
						}
						DynamicObjectTypeBuilder.EmitSerializeValue(il, type.GetTypeInfo_wzh(), item);
					}
				}
			}
			il.EmitLdarg(2);
			il.EmitLdloc(local);
			il.Emit(OpCodes.Sub);
			il.Emit(OpCodes.Ret);
		}

		// Token: 0x060003DA RID: 986 RVA: 0x0000EFDC File Offset: 0x0000D3DC
		private static void EmitOffsetPlusEqual(ILGenerator il, Action loadEmit, Action emit)
		{
			il.EmitLdarg(2);
			if (loadEmit != null)
			{
				loadEmit();
			}
			il.EmitLdarg(1);
			il.EmitLdarg(2);
			emit();
			il.Emit(OpCodes.Add);
			il.EmitStarg(2);
		}

		// Token: 0x060003DB RID: 987 RVA: 0x0000F018 File Offset: 0x0000D418
		private static void EmitSerializeValue(ILGenerator il, TypeInfo_wzh type, ObjectSerializationInfo.EmittableMember member)
		{
			Type t = member.Type;
			if (DynamicObjectTypeBuilder.IsOptimizeTargetType(t))
			{
				DynamicObjectTypeBuilder.EmitOffsetPlusEqual(il, null, delegate
				{
					il.EmitLoadArg(type, 3);
					member.EmitLoadValue(il);
					if (t == typeof(byte[]))
					{
						il.EmitCall(DynamicObjectTypeBuilder.MessagePackBinaryTypeInfo.WriteBytes);
					}
					else
					{
						il.EmitCall(DynamicObjectTypeBuilder.MessagePackBinaryTypeInfo.TypeInfo.GetDeclaredMethod("Write" + t.Name));
					}
				});
			}
			else
			{
				DynamicObjectTypeBuilder.EmitOffsetPlusEqual(il, delegate
				{
					il.EmitLdarg(4);
					il.Emit(OpCodes.Call, DynamicObjectTypeBuilder.getFormatterWithVerify.MakeGenericMethod(new Type[]
					{
						t
					}));
				}, delegate
				{
					il.EmitLoadArg(type, 3);
					member.EmitLoadValue(il);
					il.EmitLdarg(4);
					il.EmitCall(DynamicObjectTypeBuilder.getSerialize(t));
				});
			}
		}

		// Token: 0x060003DC RID: 988 RVA: 0x0000F0A4 File Offset: 0x0000D4A4
		private static void BuildDeserialize(Type type, ObjectSerializationInfo info, MethodBuilder method, FieldBuilder dictionaryField, ILGenerator il)
		{
			
		}

		// Token: 0x060003DD RID: 989 RVA: 0x0000F570 File Offset: 0x0000D970
		private static void EmitOffsetPlusReadSize(ILGenerator il)
		{
			il.EmitLdarg(2);
			il.EmitLdarg(4);
			il.Emit(OpCodes.Ldind_I4);
			il.Emit(OpCodes.Add);
			il.EmitStarg(2);
		}

		// Token: 0x060003DE RID: 990 RVA: 0x0000F5A0 File Offset: 0x0000D9A0
		private static void EmitDeserializeValue(ILGenerator il, DynamicObjectTypeBuilder.DeserializeInfo info)
		{
			ObjectSerializationInfo.EmittableMember memberInfo = info.MemberInfo;
			Type type = memberInfo.Type;
			if (DynamicObjectTypeBuilder.IsOptimizeTargetType(type))
			{
				il.EmitLdarg(1);
				il.EmitLdarg(2);
				il.EmitLdarg(4);
				if (type == typeof(byte[]))
				{
					il.EmitCall(DynamicObjectTypeBuilder.MessagePackBinaryTypeInfo.ReadBytes);
				}
				else
				{
					il.EmitCall(DynamicObjectTypeBuilder.MessagePackBinaryTypeInfo.TypeInfo.GetDeclaredMethod("Read" + type.Name));
				}
			}
			else
			{
				il.EmitLdarg(3);
				il.EmitCall(DynamicObjectTypeBuilder.getFormatterWithVerify.MakeGenericMethod(new Type[]
				{
					type
				}));
				il.EmitLdarg(1);
				il.EmitLdarg(2);
				il.EmitLdarg(3);
				il.EmitLdarg(4);
				il.EmitCall(DynamicObjectTypeBuilder.getDeserialize(type));
			}
			il.EmitStloc(info.LocalField);
		}

		// Token: 0x060003DF RID: 991 RVA: 0x0000F67C File Offset: 0x0000DA7C
		private static LocalBuilder EmitNewObject(ILGenerator il, Type type, ObjectSerializationInfo info, DynamicObjectTypeBuilder.DeserializeInfo[] members)
		{
			if (info.IsClass)
			{
				ObjectSerializationInfo.EmittableMember[] constructorParameters = info.ConstructorParameters;
				for (int i = 0; i < constructorParameters.Length; i++)
				{
					ObjectSerializationInfo.EmittableMember item = constructorParameters[i];
					DynamicObjectTypeBuilder.DeserializeInfo deserializeInfo = members.First((DynamicObjectTypeBuilder.DeserializeInfo x) => x.MemberInfo == item);
					il.EmitLdloc(deserializeInfo.LocalField);
				}
				il.Emit(OpCodes.Newobj, info.BestmatchConstructor);
				foreach (DynamicObjectTypeBuilder.DeserializeInfo deserializeInfo2 in from x in members
				where x.MemberInfo != null && x.MemberInfo.IsWritable
				select x)
				{
					il.Emit(OpCodes.Dup);
					il.EmitLdloc(deserializeInfo2.LocalField);
					deserializeInfo2.MemberInfo.EmitStoreValue(il);
				}
				return null;
			}
			LocalBuilder localBuilder = il.DeclareLocal(type);
			if (info.BestmatchConstructor == null)
			{
				il.Emit(OpCodes.Ldloca, localBuilder);
				il.Emit(OpCodes.Initobj, type);
			}
			else
			{
				ObjectSerializationInfo.EmittableMember[] constructorParameters2 = info.ConstructorParameters;
				for (int j = 0; j < constructorParameters2.Length; j++)
				{
					ObjectSerializationInfo.EmittableMember item = constructorParameters2[j];
					DynamicObjectTypeBuilder.DeserializeInfo deserializeInfo3 = members.First((DynamicObjectTypeBuilder.DeserializeInfo x) => x.MemberInfo == item);
					il.EmitLdloc(deserializeInfo3.LocalField);
				}
				il.Emit(OpCodes.Newobj, info.BestmatchConstructor);
				il.Emit(OpCodes.Stloc, localBuilder);
			}
			foreach (DynamicObjectTypeBuilder.DeserializeInfo deserializeInfo4 in from x in members
			where x.MemberInfo != null && x.MemberInfo.IsWritable
			select x)
			{
				il.EmitLdloca(localBuilder);
				il.EmitLdloc(deserializeInfo4.LocalField);
				deserializeInfo4.MemberInfo.EmitStoreValue(il);
			}
			return localBuilder;
		}

		// Token: 0x060003E0 RID: 992 RVA: 0x0000F8AC File Offset: 0x0000DCAC
		private static bool IsOptimizeTargetType(Type type)
		{
			return type == typeof(short) || type == typeof(int) || type == typeof(long) || type == typeof(ushort) || type == typeof(uint) || type == typeof(ulong) || type == typeof(float) || type == typeof(double) || type == typeof(bool) || type == typeof(byte) || type == typeof(sbyte) || type == typeof(char);
		}

		// Token: 0x04000172 RID: 370
		private static readonly Regex SubtractFullNameRegex = new Regex(", Version=\\d+.\\d+.\\d+.\\d+, Culture=\\w+, PublicKeyToken=\\w+");

		// Token: 0x04000173 RID: 371
		private static HashSet<Type> ignoreTypes = new HashSet<Type>
		{
			typeof(object),
			typeof(short),
			typeof(int),
			typeof(long),
			typeof(ushort),
			typeof(uint),
			typeof(ulong),
			typeof(float),
			typeof(double),
			typeof(bool),
			typeof(byte),
			typeof(sbyte),
			typeof(decimal),
			typeof(char),
			typeof(string),
			typeof(Guid),
			typeof(TimeSpan),
			typeof(DateTime),
			typeof(DateTimeOffset),
			typeof(Nil)
		};

		// Token: 0x04000174 RID: 372
		private static readonly Type refByte = typeof(byte[]).MakeByRefType();

		// Token: 0x04000175 RID: 373
		private static readonly Type refInt = typeof(int).MakeByRefType();

		// Token: 0x04000176 RID: 374
		private static readonly MethodInfo getFormatterWithVerify = typeof(FormatterResolverExtensions).GetRuntimeMethods_wzh().First((MethodInfo x) => x.Name == "GetFormatterWithVerify");

		// Token: 0x04000177 RID: 375
		private static readonly Func<Type, MethodInfo> getSerialize = (Type t) => typeof(IMessagePackFormatter<>).MakeGenericType(new Type[]
		{
			t
		}).GetRuntimeMethod("Serialize", new Type[]
		{
			DynamicObjectTypeBuilder.refByte,
			typeof(int),
			t,
			typeof(IFormatterResolver)
		});

		// Token: 0x04000178 RID: 376
		private static readonly Func<Type, MethodInfo> getDeserialize = (Type t) => typeof(IMessagePackFormatter<>).MakeGenericType(new Type[]
		{
			t
		}).GetRuntimeMethod("Deserialize", new Type[]
		{
			typeof(byte[]),
			typeof(int),
			typeof(IFormatterResolver),
			DynamicObjectTypeBuilder.refInt
		});

		// Token: 0x04000179 RID: 377
		private static readonly ConstructorInfo dictionaryConstructor = typeof(Dictionary<string, int>).GetTypeInfo_wzh().DeclaredConstructors.First(delegate(ConstructorInfo x)
		{
			ParameterInfo[] parameters = x.GetParameters();
			return parameters.Length == 1 && parameters[0].ParameterType == typeof(int);
		});

		// Token: 0x0400017A RID: 378
		private static readonly MethodInfo dictionaryAdd = typeof(Dictionary<string, int>).GetRuntimeMethod("Add", new Type[]
		{
			typeof(string),
			typeof(int)
		});

		// Token: 0x0400017B RID: 379
		private static readonly MethodInfo dictionaryTryGetValue = typeof(Dictionary<string, int>).GetRuntimeMethod("TryGetValue", new Type[]
		{
			typeof(string),
			DynamicObjectTypeBuilder.refInt
		});

		// Token: 0x0400017C RID: 380
		private static readonly ConstructorInfo invalidOperationExceptionConstructor = typeof(InvalidOperationException).GetTypeInfo_wzh().DeclaredConstructors.First(delegate(ConstructorInfo x)
		{
			ParameterInfo[] parameters = x.GetParameters();
			return parameters.Length == 1 && parameters[0].ParameterType == typeof(string);
		});

		// Token: 0x0400017D RID: 381
		private static readonly MethodInfo onBeforeSerialize = typeof(IMessagePackSerializationCallbackReceiver).GetRuntimeMethod("OnBeforeSerialize", Type.EmptyTypes);

		// Token: 0x0400017E RID: 382
		private static readonly MethodInfo onAfterDeserialize = typeof(IMessagePackSerializationCallbackReceiver).GetRuntimeMethod("OnAfterDeserialize", Type.EmptyTypes);

		// Token: 0x0400017F RID: 383
		private static readonly ConstructorInfo objectCtor = typeof(object).GetTypeInfo_wzh().DeclaredConstructors.First((ConstructorInfo x) => x.GetParameters().Length == 0);

		// Token: 0x02000113 RID: 275
		internal static class MessagePackBinaryTypeInfo
		{
			// Token: 0x0400018E RID: 398
			public static TypeInfo_wzh TypeInfo = typeof(MessagePackBinary).GetTypeInfo_wzh();

			// Token: 0x0400018F RID: 399
			public static MethodInfo WriteFixedMapHeaderUnsafe = typeof(MessagePackBinary).GetRuntimeMethod("WriteFixedMapHeaderUnsafe", new Type[]
			{
				DynamicObjectTypeBuilder.refByte,
				typeof(int),
				typeof(int)
			});

			// Token: 0x04000190 RID: 400
			public static MethodInfo WriteFixedArrayHeaderUnsafe = typeof(MessagePackBinary).GetRuntimeMethod("WriteFixedArrayHeaderUnsafe", new Type[]
			{
				DynamicObjectTypeBuilder.refByte,
				typeof(int),
				typeof(int)
			});

			// Token: 0x04000191 RID: 401
			public static MethodInfo WriteMapHeader = typeof(MessagePackBinary).GetRuntimeMethod("WriteMapHeader", new Type[]
			{
				DynamicObjectTypeBuilder.refByte,
				typeof(int),
				typeof(int)
			});

			// Token: 0x04000192 RID: 402
			public static MethodInfo WriteArrayHeader = typeof(MessagePackBinary).GetRuntimeMethod("WriteArrayHeader", new Type[]
			{
				DynamicObjectTypeBuilder.refByte,
				typeof(int),
				typeof(int)
			});

			// Token: 0x04000193 RID: 403
			public static MethodInfo WritePositiveFixedIntUnsafe = typeof(MessagePackBinary).GetRuntimeMethod("WritePositiveFixedIntUnsafe", new Type[]
			{
				DynamicObjectTypeBuilder.refByte,
				typeof(int),
				typeof(int)
			});

			// Token: 0x04000194 RID: 404
			public static MethodInfo WriteInt32 = typeof(MessagePackBinary).GetRuntimeMethod("WriteInt32", new Type[]
			{
				DynamicObjectTypeBuilder.refByte,
				typeof(int),
				typeof(int)
			});

			// Token: 0x04000195 RID: 405
			public static MethodInfo WriteBytes = typeof(MessagePackBinary).GetRuntimeMethod("WriteBytes", new Type[]
			{
				DynamicObjectTypeBuilder.refByte,
				typeof(int),
				typeof(byte[])
			});

			// Token: 0x04000196 RID: 406
			public static MethodInfo WriteNil = typeof(MessagePackBinary).GetRuntimeMethod("WriteNil", new Type[]
			{
				DynamicObjectTypeBuilder.refByte,
				typeof(int)
			});

			// Token: 0x04000197 RID: 407
			public static MethodInfo ReadBytes = typeof(MessagePackBinary).GetRuntimeMethod("ReadBytes", new Type[]
			{
				typeof(byte[]),
				typeof(int),
				DynamicObjectTypeBuilder.refInt
			});

			// Token: 0x04000198 RID: 408
			public static MethodInfo ReadInt32 = typeof(MessagePackBinary).GetRuntimeMethod("ReadInt32", new Type[]
			{
				typeof(byte[]),
				typeof(int),
				DynamicObjectTypeBuilder.refInt
			});

			// Token: 0x04000199 RID: 409
			public static MethodInfo ReadString = typeof(MessagePackBinary).GetRuntimeMethod("ReadString", new Type[]
			{
				typeof(byte[]),
				typeof(int),
				DynamicObjectTypeBuilder.refInt
			});

			// Token: 0x0400019A RID: 410
			public static MethodInfo IsNil = typeof(MessagePackBinary).GetRuntimeMethod("IsNil", new Type[]
			{
				typeof(byte[]),
				typeof(int)
			});

			// Token: 0x0400019B RID: 411
			public static MethodInfo ReadNextBlock = typeof(MessagePackBinary).GetRuntimeMethod("ReadNextBlock", new Type[]
			{
				typeof(byte[]),
				typeof(int)
			});

			// Token: 0x0400019C RID: 412
			public static MethodInfo WriteStringUnsafe = typeof(MessagePackBinary).GetRuntimeMethod("WriteStringUnsafe", new Type[]
			{
				DynamicObjectTypeBuilder.refByte,
				typeof(int),
				typeof(string),
				typeof(int)
			});

			// Token: 0x0400019D RID: 413
			public static MethodInfo ReadArrayHeader = typeof(MessagePackBinary).GetRuntimeMethod("ReadArrayHeader", new Type[]
			{
				typeof(byte[]),
				typeof(int),
				DynamicObjectTypeBuilder.refInt
			});

			// Token: 0x0400019E RID: 414
			public static MethodInfo ReadMapHeader = typeof(MessagePackBinary).GetRuntimeMethod("ReadMapHeader", new Type[]
			{
				typeof(byte[]),
				typeof(int),
				DynamicObjectTypeBuilder.refInt
			});
		}

		// Token: 0x02000114 RID: 276
		private class DeserializeInfo
		{
			// Token: 0x17000010 RID: 16
			// (get) Token: 0x060003F8 RID: 1016 RVA: 0x000102BD File Offset: 0x0000E6BD
			// (set) Token: 0x060003F9 RID: 1017 RVA: 0x000102C5 File Offset: 0x0000E6C5
			public ObjectSerializationInfo.EmittableMember MemberInfo { get; set; }

			// Token: 0x17000011 RID: 17
			// (get) Token: 0x060003FA RID: 1018 RVA: 0x000102CE File Offset: 0x0000E6CE
			// (set) Token: 0x060003FB RID: 1019 RVA: 0x000102D6 File Offset: 0x0000E6D6
			public LocalBuilder LocalField { get; set; }

			// Token: 0x17000012 RID: 18
			// (get) Token: 0x060003FC RID: 1020 RVA: 0x000102DF File Offset: 0x0000E6DF
			// (set) Token: 0x060003FD RID: 1021 RVA: 0x000102E7 File Offset: 0x0000E6E7
			public Label SwitchLabel { get; set; }
		}
	}
}
